package com.clw.operand;

/**
 * @author chengliwei
 * @date 2019/12/10
 */
public class Operands {

    public static Operand getByName(String name) {
        String qualifiedName = "com.clw.operand." + name;
        try {
            Class<?> operandClass = Class.forName(qualifiedName);
            return (Operand) operandClass.newInstance();
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        return null;
    }
}
